package com.huizu.project.apiController;

import com.huizu.common.annotation.Anonymous;
import com.huizu.common.annotation.Log;
import com.huizu.common.core.controller.BaseController;
import com.huizu.common.core.domain.AjaxResult;
import com.huizu.common.core.page.TableDataInfo;
import com.huizu.common.enums.BusinessType;
import com.huizu.common.utils.poi.ExcelUtil;
import com.huizu.project.domain.ProZczx;
import com.huizu.project.service.IProZczxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 政策咨询Controller
 * 
 * @author zhangmx
 * @date 2024-06-05
 */
@Anonymous
@RestController
@RequestMapping("/api/prozczx")
public class ApiProZczxController extends BaseController
{
    @Autowired
    private IProZczxService proZczxService;

    /**
     * 查询政策咨询列表
     */
    @PostMapping("/list")
    public TableDataInfo list(ProZczx proZczx)
    {   startPage();
        List<ProZczx> list = proZczxService.selectProZczxList(proZczx);
        return getDataTable(list);
    }

    /**
     * 查询政策咨询列表
     */
    @PostMapping("/listRed")
    public TableDataInfo listRed(ProZczx proZczx)
    {
        startPage();
        List<ProZczx> list = proZczxService.selectProZczxList(proZczx);
        return getDataTable(list);
    }

    /**
     * 获取政策咨询详细信息
     */
    @PostMapping(value = "/getById")
    public AjaxResult getInfo(@RequestBody ProZczx proZczx)
    {
        String id = proZczx.getId();
        return success(proZczxService.selectProZczxById(id));
    }
}
